Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Dim FirstInstallation As String, TimesWorked As Long, LicencedUser As String
Dim Licenc As Long, DemoVersion As Boolean, ReadSeries As String
Private Sub AddText(a As String)
Text1.Text = Text1.Text & vbCrLf & a
End Sub
Private Sub InitializeSystem()
On Error GoTo erro
AddText ("Initializing...")
Dim volbuf$, sysname$, serialnum&, sysflags&, componentlength&, res&
volbuf$ = String$(256, 0)
sysname$ = String$(256, 0)
res = GetVolumeInformation("C:\", volbuf$, 255, serialnum, _
componentlength, sysflags, sysname$, 255)
AddText ("HD's serial number got: " & serialnum)
'This is the math expression you can apply to get the registering code.
'Of course, you must build another app that gets the user code and returns the
'registration code, wich you pass to the user.
Licenc = Int(2802 * Sqr(serialnum))
AddText ("Licence code is " & Licenc & ", use it when registering the software.")
'LΩ data da 1¬ instalaτπo:
Dim FirstInstallationSaved As String, ReadDate As String, DateOk As String, FirstTime As Boolean